package com.yu.demo.user.domain.valueobject;

import lombok.EqualsAndHashCode;
import lombok.Getter;

/**
 * 用户ID值对象
 * 封装用户ID的业务规则和验证逻辑
 */
@Getter
@EqualsAndHashCode
public class UserId {
    private final Integer value;

    public UserId(Integer value) {
        if (value == null || value <= 0) {
            throw new IllegalArgumentException("用户ID不能为空或小于等于0");
        }
        this.value = value;
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }
}
